package com.dgut.hisystem.mapper;

import com.dgut.hisystem.entity.Register;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RegisterMapper {
    @Select({"SELECT gh_id, br_card, ys_id, gh_datetime, gh_illness FROM register_info WHERE gh_id=#{id}"})
    Register getRegisterById(long id);

    @Select({"SELECT gh_id, br_card, ys_id, gh_datetime, gh_illness FROM register_info"})
    List<Register> getRegister();

    @Select({"SELECT gh_id, br_card, ys_id, gh_datetime, gh_illness FROM register_info WHERE br_card like concat('%',#{id},'%')"})
    List<Register> getRegisterByCard(long id);

    void insert(Register register);

    void update(Register register);

    void delete(long id);
}
